package com.ethan.java8;

import com.google.common.collect.Lists;
import lombok.*;

import java.util.Comparator;
import java.util.List;

/**
 * @author ethan
 * create 2018-06-29 下午8:21
 * desc
 **/
public class SortTest {
    public static void main(String[] args){
        Person person1 = new Person(1,20,"aaa",10.11);
        Person person2 = new Person(2,25,"bbb",20.22);
        Person person3 = new Person(3,30,"ccc",30.33);
        List<Person> list = Lists.newArrayList(person1,person2,person3);

        //list.sort((p1,p2) -> Double.compare(p1.getPrice(),p2.getPrice()) );

        list.sort(Comparator.comparingDouble(Person::getPrice).reversed());

        String a="";
    }

}

